<?php
class sfBreadcrumbAction {
	
	private $symfony_name;

	private $display_name;

	private $section;
	
	private $parameters;

	public function __construct($symfony_name, $display_name, sfBreadcrumbSection $section) {
		
		$this->symfony_name = $symfony_name;

		$this->display_name = $display_name;
		
		$this->section = $section;

	}

	public function getSymfonyName() {

		return $this->symfony_name;

	}

	public function setSymfonyName($symfony_name) {

		if(is_string($symfony_name)) {

			$this->symfony_name = $symfony_name;

		}

	}

	public function getDisplayName() {

		return $this->display_name;

	}

	public function setDisplayName($display_name) {

		if(is_string($display_name)) {

			$this->display_name = $display_name;

		}

	}
	
	/*public function getAction() {
		
		return $this->action;
		
	}*/
	
	public function hasParameters() {
		
		return count($this->parameters) > 0 ? true : false;
		
	}
	
	public function setAction(sfBreadcrumbAction $action) {
		
		$this->action = $action;
		
	}
	
	public function getParameters() {
		
		return $this->parameters;
		
	}
	
	public function setParameters(array $parameters) {
		
		$this->parameters = $parameters;
		
	}
	
	public function getParameter($symfony_name) {
		
		foreach($this->parameters as $parameter) {
			
			if( $parameter->getSymfonyName() == $symfony_name ){
			
				return $parameter;
			
			}
			
		}
		
	}
	
	public function setParameter(sfBreadcrumbActionParameter $parameter) {
		
		$this->parameters[] = $parameter;
		
	}
	
}
